<?php

class IndexController extends ControllerBase
{

	public function initialize()
	{
		$this->view->setTemplateAfter('main');
		Phalcon\Tag::setTitle('Thông tin thể thao');
		parent::initialize();
	}

	public function indexAction()
	{
		$news = News::find(array('del_flg = 0', 'order' => 'created DESC'));
		
		if (count($news) == 0) {
			return false;
		}
		
		$lastest = $news->getFirst();
		$this->view->setVar("current", date('YmdHis', strtotime($lastest->created)));
		$this->view->setVar("news", $news);
	}

}
